package com.yl.chainStore.entity.warehouse

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yl.common.annotation.NoArg
import com.yl.common.getContext
import java.util.*

/**
 * <p>
 *
 * </p>
 *
 * @author cxw
 * @since 2021-07-19
 */
@NoArg
@TableName("warehouse_good_supplier")
data class WarehouseGoodSupplier(

	/**
	 * id
	 */
	@TableId(value = "id", type = IdType.AUTO)
	var id: Long,

	/**
	 * 厂商
	 */
	@TableField("name")
	var name: String,

	/**
	 * 电话
	 */
	@TableField("phone")
	var phone: String? = null,

	/**
	 * 地址
	 */
	@TableField("address")
	var address: String? = null,

	/**
	 * 部门(备用)
	 */
	@TableField("dept_id")
	var deptId: Long ?= null,

	/**
	 * 数据有效性
	 */
	@TableField("enabled")
	var enabled: Int = 1,

	/**
	 * 企业性质
	 */
	@TableField("enterprise_nature")
	var enterpriseNature: Long,

	/**
	 * 企业性质
	 */
	@TableField(exist = false)
	var enterpriseNatureName:String?=null,

	/**
	 * 备注
	 */
	@TableField("remark")
	var remark: String? = null,

	/**
	 * 联系人
	 */
	@TableField("contact")
	var contact: String? = null,

	/**
	 * 传真
	 */
	@TableField("fax")
	var fax: String? = null,

	/**
	 * 邮箱
	 */
	@TableField("email")
	var email: String? = null,

	/**
	 * 税务登记号
	 */
	@TableField("tax_id")
	var taxId: String? = null,

	/**
	 * 三证有效期
	 */
	@TableField("validity_of_three_certificates")
	var validityOfThreeCertificates: Date? = null,

	/**
	 * 三证照片
	 */
	@TableField("three_certificates_photo")
	var threeCertificatesPhoto: String? = null,

	/**
	 * 资质照片
	 */
	@TableField("photos_of_qualification")
	var photosOfQualification: String? = null,

	/**
	 * 所属公司id
	 */
	@TableField("company_id")
	var companyId: Long = getContext().companyId,

	){


	val canUpdate:Boolean
		get() {
			if(deptId == null){
				return false
			}
			return true
		}
}
